package com.hmy.finance.dal.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hmy.finance.dal.dos.ContactorsTotalArrearsAmountDo;
import com.hmy.finance.dal.dos.ContractTotalReceivableDo;
import com.hmy.finance.dal.dos.ReceivablesSumQueryDo;
import com.hmy.finance.dal.po.ReceivableInventoryPo;

import com.hmy.finance.service.core.dto.ReceivableQueryDto;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author songkf
 * @description 针对表【receivable_Inventory(应收盘点)】的数据库操作Mapper
 * @createDate 2024-02-21 18:55:01
 * @Entity com.hmy.finance.dal.po.ReceivableInventoryPo
 */
public interface ReceivableInventoryMapper extends BaseMapper<ReceivableInventoryPo> {

    /**
     * 根据客户id 签约人id获取该客户营收相关金额
     *
     * @param queryDto queryDto
     */
    ReceivablesSumQueryDo statReceivablesAmount(@Param("queryDto") ReceivableQueryDto queryDto);

    BigDecimal queryHistoryReconciledAmountByContractIdId(@Param("contractId") Long contractId);

    BigDecimal selectCustomerContractTotalArrearsAmount(@Param("customerId") Long customerId);


    List<ContractTotalReceivableDo> selectContractTotalReceivableAmount(@Param("list") List<Long> contractIds);

    /**
     * 查询客户联系人总欠款
     */
    List<ContactorsTotalArrearsAmountDo> selectContactorsContractTotalArrearsAmount(@Param("customerId") Long customerId, @Param("list") List<Long> ContactorIds);

}




